import request from '@/utils/request'

// 查询路由
export function getTaskList(query){
  return request({
    url: '/tasks/getTaskList',
    method: 'get',
    params: query
  })
}

//创建任务
export function addTask(data) {
  return request({
    url: '/tasks/createTask',
    headers: {
      isToken: false
    },
    method: 'post',
    data: data
  })
}


// 查询distribute详细
export function getTasksDetialInfoById(taskId) {
  return request({
    url: '/tasks/' + taskId,
    method: 'get'
  })
}


// 修改distribute
export function updateTasks(data) {
  return request({
    url: '/tasks/updateTask',
    method: 'put',
    data: data
  })
}



// 用户状态修改
export function changeTaskStatus(taskId, taskStatus) {
  const data = {
    taskId,
    taskStatus
  }
  return request({
    url: '/tasks/changeStatus',
    method: 'put',
    data: data
  })
}
